package com.ruoyi.gxs.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.gxs.mapper.GxsPendActivityMapper;
import com.ruoyi.gxs.domain.GxsPendActivity;
import com.ruoyi.gxs.service.IGxsPendActivityService;

/**
 * 待审批活动Service业务层处理
 * 
 * @author 高晓松
 * @date 2023-12-27
 */
@Service
public class GxsPendActivityServiceImpl implements IGxsPendActivityService 
{
    @Autowired
    private GxsPendActivityMapper gxsPendActivityMapper;

    /**
     * 查询待审批活动
     * 
     * @param gxsPendActivityid 待审批活动主键
     * @return 待审批活动
     */
    @Override
    public GxsPendActivity selectGxsPendActivityByGxsPendActivityid(Long gxsPendActivityid)
    {
        return gxsPendActivityMapper.selectGxsPendActivityByGxsPendActivityid(gxsPendActivityid);
    }

    /**
     * 查询待审批活动列表
     * 
     * @param gxsPendActivity 待审批活动
     * @return 待审批活动
     */
    @Override
    public List<GxsPendActivity> selectGxsPendActivityList(GxsPendActivity gxsPendActivity)
    {
        return gxsPendActivityMapper.selectGxsPendActivityList(gxsPendActivity);
    }

    /**
     * 新增待审批活动
     * 
     * @param gxsPendActivity 待审批活动
     * @return 结果
     */
    @Override
    public int insertGxsPendActivity(GxsPendActivity gxsPendActivity)
    {
        gxsPendActivity.setCreateTime(DateUtils.getNowDate());
        return gxsPendActivityMapper.insertGxsPendActivity(gxsPendActivity);
    }

    /**
     * 修改待审批活动
     * 
     * @param gxsPendActivity 待审批活动
     * @return 结果
     */
    @Override
    public int updateGxsPendActivity(GxsPendActivity gxsPendActivity)
    {
        gxsPendActivity.setUpdateTime(DateUtils.getNowDate());
        return gxsPendActivityMapper.updateGxsPendActivity(gxsPendActivity);
    }

    /**
     * 批量删除待审批活动
     * 
     * @param gxsPendActivityids 需要删除的待审批活动主键
     * @return 结果
     */
    @Override
    public int deleteGxsPendActivityByGxsPendActivityids(Long[] gxsPendActivityids)
    {
        return gxsPendActivityMapper.deleteGxsPendActivityByGxsPendActivityids(gxsPendActivityids);
    }

    /**
     * 删除待审批活动信息
     * 
     * @param gxsPendActivityid 待审批活动主键
     * @return 结果
     */
    @Override
    public int deleteGxsPendActivityByGxsPendActivityid(Long gxsPendActivityid)
    {
        return gxsPendActivityMapper.deleteGxsPendActivityByGxsPendActivityid(gxsPendActivityid);
    }

    @Override
    public List<GxsPendActivity> selectPendApprovedList(GxsPendActivity gxsPendActivity) {
        return gxsPendActivityMapper.selectPendApprovedList(gxsPendActivity);
    }

    @Override
    public List<GxsPendActivity> selectApprovedListt(GxsPendActivity gxsPendActivity) {
        return gxsPendActivityMapper.selectApprovedList(gxsPendActivity);
    }

    @Override
    public Boolean inquireActivity(Long userId, Long gxsPendActivityid) {
        return null;
    }

    @Override
    public List<GxsPendActivity> notInSelectGxsPendActivityList(Long userId) {

        return gxsPendActivityMapper.notInSelectGxsPendActivityList(userId);
    }

    @Override
    public List<GxsPendActivity> JoinSelectGxsPendActivityList(Long userId) {
        return gxsPendActivityMapper.JoinSelectGxsPendActivityList(userId);
    }

}
